<?php echo $this->Html->script('oldorder.js', array('inline' => false)); ?>
<div class="row">
    <div class="col-md-7" id="list-order">
        <ul class="nav-justified nav navbar">
            <li><?php echo $this->Html->link('Danh sách order', array('controller' => 'orders', 'action' => 'index'), array('class' => 'btn btn-default')); ?></li>
            <li class="active"><?php echo $this->Html->link('Tuyển chọn!', array('controller' => 'orders', 'action' => 'old'), array('class' => 'btn btn-default')); ?></li>
        </ul>
        <?php if ($listorder == null): ?>
            <div class="well">
                <h3 class="text-danger">Chưa có order nào được chọn!</h3>
            </div>
        <?php else: ?>
            <?php foreach ($listorder as $order): ?>
                <div class="item-order well" id="<?php echo $order['Order']['id']; ?>">
                    <p class="cmtout">

                    <p>

                    <h3><span class="glyphicon glyphicon-music"></span>Bài hát: <a class="listen" target="_blank"
                                                                                   href='<?php echo $order['Order']['link']; ?>'><?php echo $order['Order']['song'] ?></a>
                    </h3><span class="pull-right">Ngày chọn:<?php $convert  = strtotime($order['Order']['date']); echo date('H:i:s Y-m-d',$convert); ?></span></p>
                    <p>Do <strong><?php echo $order['Order']['sender']; ?></strong> gửi đên
                        <strong><?php echo $order['Order']['receiver']; ?></strong></p>
                    <span class="badge pull-right"><?php echo $order['Order']['number_comment'] ?></span>
                    <span class="comment pull-right glyphicon glyphicon-comment" title="comment"></span>
                    </p>
                    <div>
                        <span class="glyphicon glyphicon-bullhorn"></span>
                        Với lời nhắn:
                        <blockquote class="text-success">
                            <p><?php echo $order['Order']['message']; ?></p>
                        </blockquote>
                    </div>
                </div>
            <?php endforeach; ?>
        <?php endif; ?>
    </div>
    <div class="col-md-4 col-md-offset-1 order-form">
        <p class="text-center"><?php echo $this->Html->image('../img/order-form.png') ?></p>
        <?php echo $this->Form->create('Order', array('class' => 'form-horizontal', 'inputDefaults' => array('label' => false))); ?>
        <div class="form-group">
            <label for="receiver" class="col-md-5">Người nhận<span class="text-danger">*</span></label>

            <div class="col-md-12">
                <?php echo $this->Form->input('receiver', array('class' => 'form-control', 'placeholder' => 'Người nhận ...')); ?>
            </div>
        </div>
        <div class="form-group">
            <label for="song" class="col-md-5">Bài hát<span class="text-danger">*</span> </label>

            <div class="col-md-12">
                <?php echo $this->Form->input('song', array('class' => 'form-control', 'placeholder' => 'Bài hát ...')); ?>
            </div>
        </div>
        <div class="form-group">
            <label for="link" class="col-md-5">Link<span class="text-danger">*</span></label>

            <div class="col-md-12">
                <?php echo $this->Form->input('link', array('class' => 'form-control', 'placeholder' => 'http://')); ?>
            </div>
        </div>
        <div class="form-group"><label for="message" class="col-md-5">Lời nhắn<span
                    class="text-danger">*</span></label>

            <div class="col-md-12">
                <?php echo $this->Form->input('message', array('class' => 'form-control', 'type' => 'textarea', 'resize' => 'none', 'cols' => '4', 'placeholder' => 'Lời nhắn ...')); ?>
            </div>
        </div>
        <div class="form-group"><label for="sender" class="col-md-5">Người gửi</label>

            <div class="col-md-12">
                <?php echo $this->Form->input('sender', array('class' => 'form-control', 'placeholder' => 'Nặc danh')); ?>
            </div>
        </div>
        <?php echo $this->Form->submit('Order', array('class' => 'orderold btn btn-info btn-sm col-md-4')); ?>
        <span class="loadajax"><image width="24" height="24"
                                      src="<?php echo Router::url('/', true) . 'img/load.gif'; ?>"/></span>
        <span class="ok"><image width="24" height="24"
                                src="<?php echo Router::url('/', true) . 'img/ok.png'; ?>"/></span>
        <?php echo $this->Form->end(); ?>
    </div>
</div>
</div>

